package com.aaa.jx.controller;

import com.aaa.jx.entity.TabMenu;
import com.aaa.jx.service.TabMenuService;
import com.aaa.jx.service.impl.TabMenuServiceImpl;

import com.util.LayData;
import com.util.PrintJsonData;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.util.List;

/**
 * (TabMenu)表控制层
 *
 * @author makejava
 * @since 2023-04-26 14:21:01
 */


@WebServlet(name = "TabMenuServlet", value = "/TabMenuServlet")
public class TabMenuServlet extends HttpServlet {

    private TabMenuService tabMenuService = new TabMenuServiceImpl();

    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        // 
        String method = req.getParameter("method");
        if (method==null){
            List<TabMenu> tabMenus = tabMenuService.queryAll();
            req.setAttribute("menus",tabMenus);
            req.getRequestDispatcher("viwes/jx/main.jsp").forward(req,resp);

        }else if(method.equals("query")){
            query(req,resp);
            return;
        }else if(method.equals("add")){
            add(req,resp);
            return;
        }else if(method.equals("upd")){
            upd(req,resp);
            return;
        }else if(method.equals("del")){
            del(req,resp);
            return;
        }

    }

  

    private void del(HttpServletRequest req, HttpServletResponse resp) {
    }

    private void upd(HttpServletRequest req, HttpServletResponse resp) {
    }

    private void add(HttpServletRequest req, HttpServletResponse resp) {
    }

    private void query(HttpServletRequest req, HttpServletResponse resp) {

    }
}




